# app/controllers/user_controller.py

from flask import Blueprint,request,Flask
from utils.response_utils import ResponseUtils
from models.note_model import NoteModel
from service.shop_service import ShopService
from application.note_comment_like_application import NoteCommentLikeApplication
from app.service.common_insert_service import CommonInsertSerevice

shop = Blueprint('shop', __name__)

@shop.route('/get_goods_list', methods=['POST'])
def get_goods_list():
    user_id = request.get_json().get('goods_id')
    response = ShopService.get_goods_list(user_id)
    return ResponseUtils.success(response)

@shop.route('/get_orders_by_userId', methods=['POST'])
def get_orders_by_userId():
    user_id = request.get_json().get('user_id')
    response = ShopService.get_orders_by_userId(user_id)
    return ResponseUtils.success(response)

@shop.route('/get_carts_by_userId', methods=['POST'])
def get_carts_by_userId():
    user_id = request.get_json().get('user_id')
    response = ShopService.get_carts_by_userId(user_id)
    return ResponseUtils.success(response)

@shop.route('/get_order_by_goodid_userId', methods=['POST'])
def get_order_by_goodid_userId():
    goods_id = request.get_json().get('goods_id')
    user_id = request.get_json().get('user_id')
    response = ShopService.get_order_by_goodid_userId(goods_id,user_id)
    return ResponseUtils.success(response)